# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataProfileResultProfileFieldProfileInfoDoubleFieldInfo do
  @moduledoc """
  The profile information for a double type field.

  ## Attributes

  *   `average` (*type:* `float()`, *default:* `nil`) - Average of non-null values in the scanned data. NaN, if the field has a NaN.
  *   `max` (*type:* `float()`, *default:* `nil`) - Maximum of non-null values in the scanned data. NaN, if the field has a NaN.
  *   `min` (*type:* `float()`, *default:* `nil`) - Minimum of non-null values in the scanned data. NaN, if the field has a NaN.
  *   `quartiles` (*type:* `list(float())`, *default:* `nil`) - A quartile divides the number of data points into four parts, or quarters, of more-or-less equal size. Three main quartiles used are: The first quartile (Q1) splits off the lowest 25% of data from the highest 75%. It is also known as the lower or 25th empirical quartile, as 25% of the data is below this point. The second quartile (Q2) is the median of a data set. So, 50% of the data lies below this point. The third quartile (Q3) splits off the highest 25% of data from the lowest 75%. It is known as the upper or 75th empirical quartile, as 75% of the data lies below this point. Here, the quartiles is provided as an ordered list of quartile values for the scanned data, occurring in order Q1, median, Q3.
  *   `standardDeviation` (*type:* `float()`, *default:* `nil`) - Standard deviation of non-null values in the scanned data. NaN, if the field has a NaN.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :average => float() | nil,
          :max => float() | nil,
          :min => float() | nil,
          :quartiles => list(float()) | nil,
          :standardDeviation => float() | nil
        }

  field(:average)
  field(:max)
  field(:min)
  field(:quartiles, type: :list)
  field(:standardDeviation)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataProfileResultProfileFieldProfileInfoDoubleFieldInfo do
  def decode(value, options) do
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataProfileResultProfileFieldProfileInfoDoubleFieldInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataProfileResultProfileFieldProfileInfoDoubleFieldInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
